import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/zu-layout.vue'
import Home from '@/views/zu-home.vue'
import Find from '@/views/zu-find.vue'
import News from '@/views/zu-news.vue'
import User from '@/views/zu-user.vue'
import Map from '@/views/zu-map.vue'
const Areas = () => import('@/views/zu-areas.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      { path: '/home', component: Home },
      { path: '/find', component: Find },
      { path: '/news', component: News },
      { path: '/user', component: User }
    ]
  },
  { path: '/areas', component: Areas },
  { path: '/map', component: Map }
]

const router = new VueRouter({
  routes
})

export default router
